﻿<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/SiteLayout.Master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="carportal._Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="head"></asp:Content>

<asp:Content ID="latestcarscontent" runat="server" ContentPlaceHolderID="latestcars">
               <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:bestgifts4usConnectionString %>" 
                    SelectCommand="SELECT [vehicletype], [id] FROM [carportal_vehicletypes]">
                </asp:SqlDataSource>
                <asp:SqlDataSource ID="SqlDataSourceCounties" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:bestgifts4usConnectionString %>" 
                    
                    SelectCommand="SELECT [id], [countrycode], [countryname] FROM [carportal_countries]">
                </asp:SqlDataSource>
                <asp:SqlDataSource ID="SqlDataSourceMakes" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:bestgifts4usConnectionString %>" 
                    SelectCommand="SELECT [id], [make_name] FROM [carportal_make]">
                </asp:SqlDataSource>
                <asp:SqlDataSource ID="SqlDataSourceModel" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:bestgifts4usConnectionString %>" 
                    
        SelectCommand="SELECT id, model, make_id FROM carportal_model WHERE (make_id = @makeid)">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="DropDownListMakes" Name="makeid" 
                            PropertyName="SelectedValue" />
                    </SelectParameters>
                </asp:SqlDataSource>
                <asp:SqlDataSource ID="SqlDataSourceLatestCars" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:bestgifts4usConnectionString %>" 
                    SelectCommand="SELECT carportal_cars.id, carportal_cars.user_id, carportal_cars.make, carportal_cars.model, carportal_cars.model_by_user, carportal_cars.car_type, carportal_cars.engine_power, carportal_cars.first_reg_date, carportal_cars.millage_km, carportal_cars.fuel_type, carportal_cars.gearbox, carportal_cars.price, carportal_cars.country_code, carportal_cars.location_city, carportal_cars.climate_control, carportal_cars.seat_count, carportal_cars.color, carportal_cars.door_count, carportal_cars.Auxiliary_heating, carportal_cars.Central_locking, carportal_cars.Cruise_control, carportal_cars.Electric_heated, carportal_cars.Electric_windows, carportal_cars.Leather_seats, carportal_cars.Parking_sensors, carportal_cars.Power_Steering, carportal_cars.Sunroof, carportal_cars.Four_wheel_drive, carportal_cars.Immobilizer, carportal_cars.Xenon_headlights, carportal_cars.ABS, carportal_cars.ESP, carportal_cars.user_comments, carportal_make.id AS Expr1, carportal_make.make_name, carportal_model.id AS Expr2, carportal_model.make_id, carportal_countries.id AS Expr4, carportal_countries.countrycode, carportal_countries.countryname, carportal_vehicletypes.id AS Expr5, carportal_vehicletypes.vehicletype, carportal_search_cars.id AS Expr6, carportal_search_cars.searched_user, carportal_search_cars.make AS Expr7, carportal_search_cars.model AS Expr8, carportal_search_cars.model_by_user AS Expr9, carportal_search_cars.car_type AS Expr10, carportal_search_cars.engine_power AS Expr11, carportal_search_cars.first_reg_date AS Expr12, carportal_search_cars.millage_km_from AS Expr13, carportal_search_cars.fuel_type AS Expr14, carportal_search_cars.gearbox AS Expr15, carportal_search_cars.price_from, carportal_search_cars.price_to, carportal_search_cars.country_code AS Expr16, carportal_search_cars.location_city AS Expr17, carportal_search_cars.climate_control AS Expr18, carportal_search_cars.seat_count AS Expr19, carportal_search_cars.color AS Expr20, carportal_search_cars.door_count AS Expr21, carportal_search_cars.Auxiliary_heating AS Expr22, carportal_search_cars.Central_locking AS Expr23, carportal_search_cars.Cruise_control AS Expr24, carportal_search_cars.Electric_heated AS Expr25, carportal_search_cars.Electric_windows AS Expr26, carportal_search_cars.Leather_seats AS Expr27, carportal_search_cars.Parking_sensors AS Expr28, carportal_search_cars.Power_Steering AS Expr29, carportal_search_cars.Sunroof AS Expr30, carportal_search_cars.Four_wheel_drive AS Expr31, carportal_search_cars.Immobilizer AS Expr32, carportal_search_cars.Xenon_headlights AS Expr33, carportal_search_cars.ABS AS Expr34, carportal_search_cars.ESP AS Expr35, carportal_search_cars.user_comments AS Expr36, carportal_search_cars.first_reg_year_from, carportal_search_cars.first_reg_year_to, carportal_model.model AS modelname,carportal_make.make_name as makename FROM carportal_cars INNER JOIN carportal_make ON carportal_cars.make = carportal_make.id INNER JOIN carportal_model ON carportal_cars.model = carportal_model.id INNER JOIN carportal_countries ON carportal_cars.country_code = carportal_countries.id INNER JOIN carportal_vehicletypes ON carportal_cars.car_type = carportal_vehicletypes.id INNER JOIN carportal_search_cars ON 1 = 1 AND (carportal_cars.make = carportal_search_cars.make OR carportal_search_cars.make = - 1) AND (carportal_cars.model = carportal_search_cars.model OR carportal_search_cars.model = - 1) AND (carportal_cars.car_type = carportal_search_cars.car_type OR carportal_search_cars.car_type = - 1) AND (carportal_cars.gearbox = carportal_search_cars.gearbox OR carportal_search_cars.gearbox = '-1') AND carportal_cars.price BETWEEN carportal_search_cars.price_from AND carportal_search_cars.price_to AND carportal_cars.first_reg_date BETWEEN carportal_search_cars.first_reg_year_from AND carportal_search_cars.first_reg_year_to  ">
                </asp:SqlDataSource>

               <div class="grid_3 inh" 
                   style="z-index: 100; top: 0px; left: 0px; height: 563px; width: 170px;">
                        <ul class="tabs">
                            <li class="firs"><a href="#tab1">Find Cars</a></li>
                            <li class="last"><a href="#tab2">Offer Car</a>
                                   </li>
                        </ul>
                        <div class="tab_container1"  style="background:none">
                            <div id="tab1" class="tab_content " style="display: block; float: left;  ">
                                <div class="tab-container-padding">
                                    <fieldset>
                                        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                                            <ContentTemplate>
                                                <div class="rowElem select">
                                                    <span class="name-input">Make:</span>
                                                    <asp:DropDownList ID="DropDownListMakes" runat="server" DataSourceID="SqlDataSourceMakes"
                                                        DataTextField="make_name" DataValueField="id" Height="25px" Width="175px" AutoPostBack="True">
                                                    </asp:DropDownList>
                                                    <div class="clear">
                                                    </div>
                                                </div>
                                                <div class="rowElem select">
                                                    <span class="name-input1">Model:</span>
                                                    <asp:DropDownList ID="DropDownListModels" runat="server" DataSourceID="SqlDataSourceModel"
                                                        DataTextField="model" DataValueField="id" Height="25px" Width="175px">
                                                        <asp:ListItem Value="-1">Any</asp:ListItem>
                                                    </asp:DropDownList>
                                            </ContentTemplate>
                                        </asp:UpdatePanel>
                                        <div class="clear">
                                        </div>
                                </div>
                                <div class="rowElem select">
                                    <span class="name-input1">Region:</span>
                                    <asp:DropDownList ID="DropDownList10" runat="server" Height="25px" Width="175px">
                                    </asp:DropDownList>
                                    &nbsp;<div class="clear">
                                    </div>
                                </div>
                                <div class="mini-blok">
                                    <div class="rowElem select2">
                                        <span class="name-input1">Min Year:</span>
                                        <asp:DropDownList ID="DropDownList8" runat="server" Height="25px" Width="80px">
                                            <asp:ListItem meta:resourcekey="ListItemResource1">2012</asp:ListItem>
                                            <asp:ListItem meta:resourcekey="ListItemResource2">2011</asp:ListItem>
                                            <asp:ListItem meta:resourcekey="ListItemResource3">2010</asp:ListItem>
                                            <asp:ListItem meta:resourcekey="ListItemResource4">2009</asp:ListItem>
                                            <asp:ListItem meta:resourcekey="ListItemResource5">2008</asp:ListItem>
                                            <asp:ListItem meta:resourcekey="ListItemResource6">2007</asp:ListItem>
                                            <asp:ListItem meta:resourcekey="ListItemResource7">2006</asp:ListItem>
                                            <asp:ListItem meta:resourcekey="ListItemResource8">2005</asp:ListItem>
                                            <asp:ListItem meta:resourcekey="ListItemResource9">2004</asp:ListItem>
                                            <asp:ListItem meta:resourcekey="ListItemResource10">2003</asp:ListItem>
                                            <asp:ListItem meta:resourcekey="ListItemResource11">2002</asp:ListItem>
                                            <asp:ListItem meta:resourcekey="ListItemResource12">2001</asp:ListItem>
                                            <asp:ListItem meta:resourcekey="ListItemResource13" Selected="True">2000</asp:ListItem>
                                        </asp:DropDownList>
                                        <div class="clear">
                                        </div>
                                    </div>
                                    <div class="rowElem select2">
                                        <span class="name-input1">Min Price:</span>
                                        <asp:DropDownList ID="DropDownList5" runat="server" Height="25px" Width="80px">
                                            <asp:ListItem>300</asp:ListItem>
                                            <asp:ListItem>400</asp:ListItem>
                                            <asp:ListItem>500</asp:ListItem>
                                            <asp:ListItem>600</asp:ListItem>
                                            <asp:ListItem>700</asp:ListItem>
                                            <asp:ListItem>800</asp:ListItem>
                                            <asp:ListItem>900</asp:ListItem>
                                            <asp:ListItem>1000</asp:ListItem>
                                            <asp:ListItem>1100</asp:ListItem>
                                            <asp:ListItem>1200</asp:ListItem>
                                            <asp:ListItem>1300</asp:ListItem>
                                            <asp:ListItem>1400</asp:ListItem>
                                            <asp:ListItem>1500</asp:ListItem>
                                            <asp:ListItem>1600</asp:ListItem>
                                            <asp:ListItem>1700</asp:ListItem>
                                            <asp:ListItem>1800</asp:ListItem>
                                            <asp:ListItem>1900</asp:ListItem>
                                            <asp:ListItem>2000</asp:ListItem>
                                            <asp:ListItem>2500</asp:ListItem>
                                            <asp:ListItem>3000</asp:ListItem>
                                            <asp:ListItem>3500</asp:ListItem>
                                            <asp:ListItem>4000</asp:ListItem>
                                            <asp:ListItem>4500</asp:ListItem>
                                            <asp:ListItem>5000</asp:ListItem>
                                            <asp:ListItem>5500</asp:ListItem>
                                            <asp:ListItem>6000</asp:ListItem>
                                            <asp:ListItem>6500</asp:ListItem>
                                            <asp:ListItem>7000</asp:ListItem>
                                            <asp:ListItem>7500</asp:ListItem>
                                            <asp:ListItem>8000</asp:ListItem>
                                            <asp:ListItem>8500</asp:ListItem>
                                            <asp:ListItem>9000</asp:ListItem>
                                            <asp:ListItem>9500</asp:ListItem>
                                            <asp:ListItem>10000</asp:ListItem>
                                            <asp:ListItem>10500</asp:ListItem>
                                            <asp:ListItem>11000</asp:ListItem>
                                            <asp:ListItem>11500</asp:ListItem>
                                            <asp:ListItem>12000</asp:ListItem>
                                            <asp:ListItem>12500</asp:ListItem>
                                            <asp:ListItem>13000</asp:ListItem>
                                            <asp:ListItem>13500</asp:ListItem>
                                            <asp:ListItem>14000</asp:ListItem>
                                            <asp:ListItem>14500</asp:ListItem>
                                            <asp:ListItem>15000</asp:ListItem>
                                            <asp:ListItem>15500</asp:ListItem>
                                            <asp:ListItem>16000</asp:ListItem>
                                            <asp:ListItem>16500</asp:ListItem>
                                            <asp:ListItem>17000</asp:ListItem>
                                            <asp:ListItem>17500</asp:ListItem>
                                            <asp:ListItem>18000</asp:ListItem>
                                            <asp:ListItem>18500</asp:ListItem>
                                            <asp:ListItem>19000</asp:ListItem>
                                            <asp:ListItem>19500</asp:ListItem>
                                            <asp:ListItem>20000</asp:ListItem>
                                        </asp:DropDownList>
                                        <div class="clear">
                                        </div>
                                    </div>
                                </div>
                                <div class="mini-blok1">
                                    <div class="rowElem select2">
                                        <span class="name-input1">Max Year:</span>
                                        <asp:DropDownList ID="DropDownList9" runat="server" Height="25px" Width="80px">
                                            <asp:ListItem meta:resourcekey="ListItemResource1">2012</asp:ListItem>
                                            <asp:ListItem meta:resourcekey="ListItemResource2">2011</asp:ListItem>
                                            <asp:ListItem meta:resourcekey="ListItemResource3">2010</asp:ListItem>
                                            <asp:ListItem meta:resourcekey="ListItemResource4">2009</asp:ListItem>
                                            <asp:ListItem meta:resourcekey="ListItemResource5">2008</asp:ListItem>
                                            <asp:ListItem meta:resourcekey="ListItemResource6">2007</asp:ListItem>
                                            <asp:ListItem meta:resourcekey="ListItemResource7">2006</asp:ListItem>
                                            <asp:ListItem meta:resourcekey="ListItemResource8">2005</asp:ListItem>
                                            <asp:ListItem meta:resourcekey="ListItemResource9">2004</asp:ListItem>
                                            <asp:ListItem meta:resourcekey="ListItemResource10">2003</asp:ListItem>
                                            <asp:ListItem meta:resourcekey="ListItemResource11">2002</asp:ListItem>
                                            <asp:ListItem meta:resourcekey="ListItemResource12">2001</asp:ListItem>
                                            <asp:ListItem meta:resourcekey="ListItemResource13">2000</asp:ListItem>
                                        </asp:DropDownList>
                                        <div class="clear">
                                        </div>
                                    </div>
                                    <div class="rowElem select2">
                                        <span class="name-input1">Max price:</span>
                                        <asp:DropDownList ID="DropDownList6" runat="server" Height="25px" Width="80px">
                                            <asp:ListItem>30001</asp:ListItem>
                                            <asp:ListItem>40001</asp:ListItem>
                                            <asp:ListItem>50001</asp:ListItem>
                                            <asp:ListItem>60001</asp:ListItem>
                                            <asp:ListItem>70001</asp:ListItem>
                                            <asp:ListItem>80001</asp:ListItem>
                                            <asp:ListItem>90001</asp:ListItem>
                                            <asp:ListItem>100001</asp:ListItem>
                                            <asp:ListItem>120001</asp:ListItem>
                                            <asp:ListItem>140001</asp:ListItem>
                                            <asp:ListItem>160001</asp:ListItem>
                                            <asp:ListItem>180001</asp:ListItem>
                                            <asp:ListItem>200001</asp:ListItem>
                                            <asp:ListItem>220001</asp:ListItem>
                                            <asp:ListItem>240001</asp:ListItem>
                                            <asp:ListItem>260001</asp:ListItem>
                                            <asp:ListItem>280001</asp:ListItem>
                                            <asp:ListItem>300001</asp:ListItem>
                                            <asp:ListItem>>300001</asp:ListItem>
                                        </asp:DropDownList>
                                        <div class="clear">
                                        </div>
                                    </div>
                                </div>
                                <div class="clear">
                                </div>
                                <div class="rowElem select">
                                    <span class="name-input1">Body Type:</span>
                                    <asp:DropDownList ID="DropDownList1" runat="server" AppendDataBoundItems="True" DataSourceID="SqlDataSource1"
                                        DataTextField="vehicletype" DataValueField="id" Height="26px" Width="175px">
                                        <asp:ListItem Value="-1">Any</asp:ListItem>
                                    </asp:DropDownList>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="clear">
                                </div>
                                <div class="box-form-button">
                                    <table><tr><td><asp:Button runat="server" ID="SearchCar" Text="Search" OnClick="SearchCar_Click"
                                        Height="43px" Width="90px"></asp:Button><br /></td><td>&nbsp;</td><td valign="middle"><a href="/Search1.aspx">Detaild search</a></td></tr></table>
                                    
                                    <%--	<div class="wrapper">
                                <ul class="tabs-1">
                                    <li><a href="#tab3">Latest <span>used cars</span></a></li>
                                    <li><a href="#tab4">Latest <span>new cars</span></a></li>
                                </ul>
                            </div>--%>
                                </div>
                                </fieldset>
                            </div>
                        </div>
                        
                    </div>
    <h3 class="light">Latest Cars</h3>
                                <div class="box-2-container">
<asp:UpdatePanel ID="UpdatePanel3" runat="server">
                                        <ContentTemplate>
                                            <asp:ListView ID="ListView3" runat="server" 
                                                DataKeyNames="id,Expr1,Expr2,Expr4,Expr5,Expr6" 
                                                DataSourceID="SqlDataSourceLatestCars">
                                                <EmptyDataTemplate>
                                                    <table runat="server" style="">
                                                        <tr>
                                                            <td>
                                                                No data was returned.</td>
                                                        </tr>
                                                    </table>
                                                </EmptyDataTemplate>
                                                <EmptyItemTemplate>
<td runat="server" />
                                                        </EmptyItemTemplate>
                                                <GroupTemplate>
                                                    <tr ID="itemPlaceholderContainer" runat="server">
                                                        <td ID="itemPlaceholder" runat="server">
                                                        </td>
                                                    </tr>
                                                </GroupTemplate>
                                                <ItemTemplate>
                                                    <td runat="server" style="">
                                                        <div class="tab-col .tab-col-indent-noborder">
                                                            <div class="p2">
                                                              <table><tr><td><a href="carview.aspx?carid=<%# Eval("id") %>"><img alt="" Height="80px" 
                                                                    src='<%# "UploadImages/"+ Eval("id") + "_001.jpg" %>' Width="60px"> </img>
                                                                
                                                                </a></td><td>&nbsp&nbsp</td><td> <span class="block mb5"><a class="link-2" href="#">
                                                            <asp:Literal runat="server" Text='<%# Eval("makename") %>' />
                                                            &nbsp;
                                                            <asp:Literal runat="server" Text='<%# Eval("modelname") %>' />
                                                            &nbsp;</a></span> 
                                                              <span class="block text-1">Price: <strong class="color-5">$
                                                            <asp:Label runat="server" Text='<%# Eval("price") %>'></asp:Label>
                                                            </strong></span></td></tr></table>
                                                        </div>
                                            
                                                    </td>
                                                </ItemTemplate>
                                                <LayoutTemplate>
                                                    <table runat="server">
                                                        <tr runat="server">
                                                            <td runat="server">
                                                                <table ID="groupPlaceholderContainer" runat="server" border="0" style="">
                                                                    <tr ID="groupPlaceholder" runat="server">
                                                                    </tr>
                                                                </table>
                                                            </td>
                                                        </tr>
                                                        <tr runat="server">
                                                            <td runat="server" style="">
                                                                <asp:DataPager ID="DataPager1_2" runat="server" PageSize="2">
                                                                    <Fields>
                                                                        <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                                                                            ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                                                        <asp:NumericPagerField />
                                                                        <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" 
                                                                            ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                                                    </Fields>
                                                                </asp:DataPager>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </LayoutTemplate>
                                            </asp:ListView>
                                        </ContentTemplate>
                                    </asp:UpdatePanel>
                                    </div>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
    <h2>
        &nbsp;</h2>
    <figure><img src="images/page1-img1.jpg"  alt=""></figure>
    <div class="banner">
        <div class="banner-padding">
            <div class="wrapper">
                <span class="text-3 fleft">Ferrari 458 Spider 2012 <span>$1,075.999</span></span>&nbsp;
                <a class="button-6 fright" href="#">Learn More</a></div>
        </div>
    </div>
    <div>
        <table style="width: 76%; text-align: center;">
            <tr>
                <td colspan="2">
                    Placeholder1
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                </td>
            </tr>
            <tr>
                <td>
    Placeholder2 
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                </td>
                <td>
                    PLaceholder3</td>
            </tr>
        </table>
    </div>
</asp:Content>
